package caj.springboot.model;

import caj.springboot.common.SysConstants;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;

/**
 * @description: 分页参数对象
 * @author: CAJ
 * @time: 2023/12/7 17:02
 */
@SuperBuilder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Paginate {

    @NotNull(message = "当前页码不能为空")
    @Positive(message = "当前页码必须大于0")
    @ApiModelProperty("当前页码")
    private Integer index = SysConstants.PAGE_INDEX_START_DEFAULT;


    @NotNull(message = "条目数不能为空")
    @Positive(message = "条目数必须大于0")
    @ApiModelProperty("每页数目")
    private Integer size = SysConstants.PAGE_SIZE_DEFAULT;
}
